#ifndef SALARYDETAILVIEW_H
#define SALARYDETAILVIEW_H

#include <QWidget>
#include <QTableWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QDateEdit>
#include <QPushButton>
#include <QHBoxLayout>
#include <QComboBox>
#include <QLineEdit>

class EmployeeManager;
class AdminManager;

class SalaryDetailView : public QWidget
{
    Q_OBJECT

public:
    explicit SalaryDetailView(EmployeeManager *manager, AdminManager *adminManager, const QString &empId = "", bool isAdmin = false, QWidget *parent = nullptr);
    ~SalaryDetailView();

    // 设置员工ID
    void setEmployeeId(const QString &empId);

    SalaryDetailView(EmployeeManager *manager, const QString &empId, QWidget *parent);
private:
    // 初始化UI
    void initUI();
    // 加载工资详情
    void loadSalaryDetails();
    // 搜索工资详情
    void onSearchSalary();
private:
    EmployeeManager *m_manager;
    AdminManager *m_adminManager;
    QString m_empId;
    bool m_isAdmin;

    // UI组件
    QTableWidget *m_salaryTable;
    QLabel *m_statusLabel;
    QDateEdit *m_startDateEdit;
    QDateEdit *m_endDateEdit;
    QPushButton *m_searchButton;
    QComboBox *m_periodComboBox;
    QComboBox *m_deptComboBox;
    QLineEdit *m_paymentPeriodEdit;
    QPushButton *m_distributeButton;
};

#endif // SALARYDETAILVIEW_H
